package org.lonetree.tc.core.dao;

import java.util.Set;
import org.lonetree.tc.core.Course;
import org.lonetree.tc.core.CourseComment;
import org.lonetree.tc.core.Course.CourseId;
import org.lonetree.tc.core.exception.AttributeCannotBeNullException;
import org.lonetree.tc.core.exception.ItemAlreadyExistsException;
import org.lonetree.tc.core.exception.NoSuchItemException;
import org.lonetree.tc.core.exception.SearchException;
import org.lonetree.tc.core.search.CourseCriteria;


/**
 * JAVADOC CourseDAO
 *
 * @author xeon
 *
 */
public interface CourseDAO{

	/**
	 * JAVADOC CourseDAO.getCourse()
	 *
	 * @param courseId
	 * @return
	 * @throws NoSuchItemException
	 */
	public Course getCourse(CourseId courseId) throws NoSuchItemException;
	
	/**
	 * JAVADOC CourseDAO.createCourse()
	 *
	 * @param courseId
	 * @return
	 * @throws ItemAlreadyExistsException
	 */
	public Course createCourse(CourseId courseId) throws ItemAlreadyExistsException;
	
	/**
	 * JAVADOC CourseDAO.removeCourse()
	 *
	 * @param courseId
	 * @throws NoSuchItemException
	 */
	public void removeCourse(CourseId courseId) throws NoSuchItemException;
	
	/**
	 * JAVADOC CourseDAO.updateCourse()
	 *
	 * @param course
	 * @throws NoSuchItemException
	 * @throws AttributeCannotBeNullException
	 */
	public void updateCourse(Course course) throws NoSuchItemException, AttributeCannotBeNullException;
	
	/**
	 * JAVADOC CourseDAO.findCourses()
	 *
	 * @param criteria
	 * @return
	 * @throws SearchException
	 */
	public Set<Course> findCourses(CourseCriteria criteria) throws SearchException;
	
	/**
	 * JAVADOC BookDAO.getFlaggedCourseComments()
	 *
	 * @return
	 */
	public Set<CourseComment> getFlaggedCourseComments();
}
